package com.itheima.test3;

public class Demo3 {
    public static void main(String[] args) {
        GoSwimming(new Swimming() {
            @Override
            public void swim() {
                System.out.println("去游泳吧");
            }
        });
        System.out.println("----------------------");
        GoSwimming(()->{System.out.println("去游泳吧");});
        System.out.println("----------------------");
        GoSwimming(()->System.out.println("去游泳吧"));
    }

    public static void GoSwimming(Swimming swimming) {
        swimming.swim();
    }
}

interface Swimming {
    void swim();
}
